package com.jservice.api.service.smk;

import com.jservice.api.MsgCode;
import com.jservice.api.dto.Request;
import com.jservice.api.dto.Response;
import com.jservice.api.dto.ResponseHeader;
import com.jservice.api.service.BaseService;
import com.jservice.api.service.IService;
import com.jservice.framework.utils.StringUtils;
import com.jservice.model.SmkSms;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Smk0018 - 查看通知详情
 *
 * @Author cwledit
 * @DATE 2017/6/16.
 */
@Service("smk0018")
public class Smk0018 extends BaseService implements IService{

    @Override
    public Response excute(Request request, Response response, ResponseHeader header, String method) throws Exception {
        Map paramMap = request.getData();
        String id = paramsStringFilter(paramMap.get("id"));
        if (StringUtils.isEmpty(id)){
            return renderFAIL(MsgCode.Code_1008,"参数缺少:id",response,header);
        }
        SmkSms smkSms = SmkSms.dao.doFindFirst(" id = ? ",id);
        smkSms.setStatus("1");
        smkSms.update();
        return renderSUC(smkSms,response,header);

    }
}
